package org.cevahir.alumni.model;

// Generated 29-Jun-2008 12:22:55 by Hibernate Tools 3.2.2.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Job generated by hbm2java
 */
@Entity
@Table(name = "job", catalog = "alumni")
public class Job extends Model implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3181974280547725581L;
	private int id;
	private Position position;
	private Firm firm;
	private City city;
	private String details;
	private short privacyLevel;
	private boolean deleted;
	private Date creationDate;
	private Date deletionDate;
	private Set<User> users = new HashSet<User>(0);

	public Job() {
	}

	public Job(int id, short privacyLevel, boolean deleted, Date creationDate) {
		this.id = id;
		this.privacyLevel = privacyLevel;
		this.deleted = deleted;
		this.creationDate = creationDate;
	}

	public Job(int id, Position position, Firm firm, City city, String details,
			short privacyLevel, boolean deleted, Date creationDate,
			Date deletionDate, Set<User> users) {
		this.id = id;
		this.position = position;
		this.firm = firm;
		this.city = city;
		this.details = details;
		this.privacyLevel = privacyLevel;
		this.deleted = deleted;
		this.creationDate = creationDate;
		this.deletionDate = deletionDate;
		this.users = users;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "position_id")
	public Position getPosition() {
		return this.position;
	}

	public void setPosition(Position position) {
		this.position = position;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "firm_id")
	public Firm getFirm() {
		return this.firm;
	}

	public void setFirm(Firm firm) {
		this.firm = firm;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "city_id")
	public City getCity() {
		return this.city;
	}

	public void setCity(City city) {
		this.city = city;
	}

	@Column(name = "details")
	public String getDetails() {
		return this.details;
	}

	public void setDetails(String details) {
		this.details = details;
	}

	@Column(name = "privacy_level", nullable = false)
	public short getPrivacyLevel() {
		return this.privacyLevel;
	}

	public void setPrivacyLevel(short privacyLevel) {
		this.privacyLevel = privacyLevel;
	}

	@Column(name = "deleted", nullable = false)
	public boolean isDeleted() {
		return this.deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "creation_date", nullable = false, length = 29)
	public Date getCreationDate() {
		return this.creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "deletion_date", length = 29)
	public Date getDeletionDate() {
		return this.deletionDate;
	}

	public void setDeletionDate(Date deletionDate) {
		this.deletionDate = deletionDate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "job")
	public Set<User> getUsers() {
		return this.users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}

}
